package com.ds.dalgen.context;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ds.dalgen.config.Configuration;
import com.ds.dalgen.db.domain.TableInfo;
import com.ds.dalgen.generator.domain.GeneratorInfo;
import com.ds.dalgen.loader.DefaultLoader;
import com.ds.dalgen.loader.Loader;

public class Context {

	private Configuration configuration;

	private Map<String, TableInfo> tableInfos;

	private List<GeneratorInfo> generatorInfos;

	private Loader loader;

	public Context() {

		configuration = new Configuration();
		tableInfos = new HashMap<String, TableInfo>();
		generatorInfos = new ArrayList<GeneratorInfo>();

		try {
			loader = new DefaultLoader();
			loader.loadContext(this);
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

	public List<GeneratorInfo> getGeneratorInfos() {
		return generatorInfos;
	}

	public void setGeneratorInfos(List<GeneratorInfo> generatorInfos) {
		this.generatorInfos = generatorInfos;
	}

	public Map<String, TableInfo> getTableInfos() {
		return tableInfos;
	}

	public void setTableInfos(Map<String, TableInfo> tableInfos) {
		this.tableInfos = tableInfos;
	}

	public Configuration getConfiguration() {
		return configuration;
	}

	public void setConfiguration(Configuration configuration) {
		this.configuration = configuration;
	}

}
